/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     struct TreeNode *left;
 *     struct TreeNode *right;
 * };
 */
bool isSameTree(struct TreeNode* p, struct TreeNode* q) {
    if (p == NULL && q == NULL)//判断空节点
        return true;
    if (p == NULL && q != NULL || p != NULL && q == NULL)//判断两树结构
        return false;
    else if (p->val != q->val)//判断值
        return false;
    else
        return isSameTree(p->left, q->left) && isSameTree(p->right, q->right);

}